<?php $this->registerCssFile("@web/css/swiper.min.css",['depends'=>['app\assets\AppAsset']]);?>
<?php $this->registerCssFile("@web/css/index.css",['depends'=>['app\assets\AppAsset']]);?>
<?php $this->registerJsFile("@web/js/laydate.js",['depends'=>['app\assets\AppAsset']]);?>
<?php $this->registerJsFile("@web/js/swiper.jquery.min.js",['depends'=>['app\assets\AppAsset']]);?>
<?php $this->registerJsFile("@web/js/main.js",['depends'=>['app\assets\AppAsset']]);?>
<div id="e"></div>
<div class="lead-nav row">
	<div class="news col-sm-6">
		jj ijoi joi joiiu u ui iu uh iuhuhui u iu u hiu huihiuhu ihiu hiu uhiu hiu hu hiu uih jhjhijhij hi
	</div>
	<div class="lf col-sm-offset-2 col-sm-4">
		<div class="find"><a href="<?= \yii\helpers\Url::to(["publish/find_publish"])?>" class="btn btn-primary btn-lg">+&nbsp;&nbsp;&nbsp;&nbsp;招领启示</a></div>
		<div class="lost"><a href="<?= \yii\helpers\Url::to(["publish/lost_publish"])?>" class="btn btn-primary btn-lg">+&nbsp;&nbsp;&nbsp;&nbsp;寻物启事</a></div>
	</div>
</div>
<div class="things">

	<div class="swiper-container">
	    <div class="swiper-wrapper">
		<?php
			$count=count($total);
			$n=intval(($count-1)/9)+1;
			//  一共有几页
			for ($i = 0; $i < $n; $i++){
				//每一页有几个
		?>
			<div class="swiper-slide">
		<?php
				for($j = 0; $j < ($count-9*$i)&&($j<9);$j++){
				$index=$i*9+$j;
		?>
				<div class="thing-mol col-sm-4 clearfix <?=$total[$index]["add_type"]=="寻"?"type-find":"type-lost"; ?>" id="<?=$total[$index]["id"] ?>" data-type="<?=$total[$index]["class"] ?>">
					<div class="thing-img pull-left"><img src="<?= $total[$index]["img_url"]?\yii\helpers\Url::to("@web/".$total[$index]["img_url"]):\yii\helpers\Url::to("@web/images/block.jpg"); ?>"></div>
					<div class="thing-details pull-left">
						<p class="lost-find"><?=$total[$index]["add_type"] ?></p>
						<p class="type">物品: <span class="#"><?=$total[$index]["name"] ?></span></p>
						<p class="place">地点: <span class="#"><?=$total[$index]["place"] ?></span></p>
						<p class="time">时间: <span class="#"><?=$total[$index]["time"] ?></span></p>
						<div class="publish-time">
							发布时间: <span><?=date("Y-m-d H:i",$total[$index]["publish_time"]) ?></span>
						</div>
						<p class="link-this-details"><a href="<?= $total[$index]["add_type"]=="寻"?\yii\helpers\Url::to(["details/find_details","id"=>$total[$index]["id"]]):\yii\helpers\Url::to(["details/lost_details","id"=>$total[$index]["id"]]); ?>">查看详情>></a></p>
					</div>
				</div>
		<?php
				}
		?>
			</div>
		<?php
			}
		?>
	    </div>
	    <!-- 如果需要分页器 -->
	    <div class="swiper-pagination page"></div>
	</div>
</div>
<script type="text/javascript">
window.onload=function(){
	var mySwiper = new Swiper ('.swiper-container', {
	    loop: false,
	    
	    // 如果需要分页器
	    pagination: '.swiper-pagination',
		paginationClickable: true,
		paginationBulletRender: function (swiper, index, className) {
			return '<span class="' + className + '">' + (index + 1) + '</span>';
		},
	  })       
	}
</script>
